package chixing.day12.generic;

/**
 * 坐标类  <整数，小数，字符串>
 *<E> 泛型 （类型参数化）
 * 作用：保证数据的安全性
 */
public class Point<E> {
    private E x;
    private E y;
    public Point(){}

    public Point(E x, E y) {
        this.x = x;
        this.y = y;
    }

    public E getX() {
        return x;
    }

    public void setX(E x) {
        this.x = x;
    }

    public E getY() {
        return y;
    }

    public void setY(E y) {
        this.y = y;
    }

    @Override
    public String toString() {
        return "Point{" +
                "x=" + x +
                ", y=" + y +
                '}';
    }
}
